<include file="../Public/header.html" />
<link href="__PUBLIC__/Css/productList.css" rel="stylesheet" type="text/css" />

<!--页面主部-->
<div id="main"> 
  <!--头部现在位置-->
	<include file="../Product/Tpl/default/Public/p_top_nav.html" />
	<include file="../Product/Tpl/default/Public/area_left_productlist.html" />
 	
  <!--页面主要内容-->
  <div id="right"> 
    <!--商品筛选框-->
    <div class="elect_box">
    	
      
      <dl style="border:none;">
      	<php>if(!empty($populars)&&$gettype!='delivery'){</php>
      	<dt><strong>地点：</strong></dt>
        <dd id="didian" class="">
          <ul>
            <li> <span rel=''>
            			<a href="javascript:void(0)" 
            				onclick="$('#searchpform').find('#popu_title').val('');
            								 k_changeGroupStyle('didian','ul > li > span ','','elect_on');
            								 $('#searchpform').submit();" >
            				全部
            			</a></span> 
            </li>
            <php>	
			    				foreach($populars as $vob){
			    	</php>
								  <li> <span rel='{$vob['title']}'>
								  			<a href="javascript:void(0)" 
								  				 onclick="$('#searchpform').find('#popu_title').val('{$vob['title']}');
								  				 					k_changeGroupStyle('didian','ul > li > span ','{$vob['title']}','elect_on');
								  				 					$('#searchpform').submit();" 
								  				 title="{$vob['title']}">{$vob['title']}</a></span> </li>
								 
			      <php>	
			      		 	}
			      </php>
          </ul>
          <!--  
          <span class="fold unfold" rel='unfold' 
          			onclick="		if($(this).attr('rel')=='fold'){
          										$(this).addClass('unfold');
          										$('#didian').removeClass('pinpai');
          										$(this).attr('rel','unfold');
          									}else{
          										$(this).removeClass('unfold');
          										$('#didian').addClass('pinpai');
          										$(this).attr('rel','fold');
          									}
          ">
          </span>
          --> 
        </dd>
        <php>}</php>
        <php>if(!empty($listBrand)){</php>
        <!--品牌筛选框-->
        <div class="clear"></div>
        <dt><strong>品牌：</strong></dt>
        <dd id="pinpai" class="">
        	<span class="fold unfold" rel='unfold' 
          			onclick="		if($(this).attr('rel')=='fold'){
          										$(this).addClass('unfold');
          										$('#pinpai').removeClass('pinpai');
          										$(this).attr('rel','unfold');
          									}else{
          										$(this).removeClass('unfold');
          										$('#pinpai').addClass('pinpai');
          										$(this).attr('rel','fold');
          									}
	          ">
	          </span> 
          <ul>
            <li> <span rel=''>
            			<a href="javascript:void(0)" 
            				onclick="$('#searchpform').find('#brandid').val('');
            								 k_changeGroupStyle('pinpai','ul > li > span ','','elect_on');
            								 $('#searchpform').submit();" >
            				全部
            			</a></span> 
            </li>
            <php>	
			    				foreach($listBrand as $vob){
			    	</php>
								  <li> <span rel='{$vob['id']}'>
								  			<a href="javascript:void(0)" 
								  				 onclick="$('#searchpform').find('#brandid').val('{$vob['id']}');
								  				 					k_changeGroupStyle('pinpai','ul > li > span ','{$vob['id']}','elect_on');
								  				 					$('#searchpform').submit();" 
								  				 title="{$vob['title']}">{$vob['title']}</a></span> </li>
								 
			      <php>	
			      		 	}
			      </php>
          </ul>
          
        </dd>
      <!--类型筛选框-->
      <php>}else{ $brandid=''; }</php>
      </dl>
      <div class="clear"></div>
      <php>if(!empty($subSortList)){</php>
      <dl id="searchsort">
        <dt><strong>类型：</strong></dt>
        <dd>
          <ul>
	            <li> <span rel=''>
	            		<a href="javascript:void(0)" 
								  		 onclick="$('#searchpform').find('#ssscode').val('');
								  		 					k_changeGroupStyle('searchsort','dd > ul > li > span ','','elect_on');
								  		 					$('#searchpform').submit();" 
								  		 >全部</a></span> </li>
            <php>	
			    				foreach($subSortList as $vo){
			    	</php>
								  <li> <span rel='{$vo['code']}'>
								  	<a href="javascript:void(0)" 
								  		 onclick="$('#searchpform').find('#ssscode').val('{$vo['code']}');
								  		 					k_changeGroupStyle('searchsort','dd > ul > li > span ','{$vo['code']}','elect_on');
								  		 					$('#searchpform').submit();" 
								  		 title="{$vo['desc']}">{$vo['desc']}</a></span> </li>
			      <php>	
			      		 	}
			      </php>
          </ul>
        </dd>
      </dl>
      <div class="clear"></div>
      <php>}else{ $ssscode=''; }</php>
      <dl id='searchfangshi'>
        <dt><strong>方式：</strong></dt>
        <dd>
        	<ul>
        		<li><span rel=""><a href="javascript:void(0)" 
								  		 onclick="$('#searchpform').find('#gettype').val('');
								  		 					k_changeGroupStyle('searchfangshi','dd > ul > li > span ','','elect_on');
								  		 					$('#searchpform').submit();" 
								  		 >全部</a></span></li>
	            <li><span rel="self"><a href="javascript:void(0)" 
								  		 onclick="$('#searchpform').find('#gettype').val('self');
								  		 					k_changeGroupStyle('searchfangshi','dd > ul > li > span ','','elect_on');
								  		 					$('#searchpform').submit();" 
								  		 >到店自取</a></span></li>
				<li><span rel="delivery"><a href="javascript:void(0)" 
								  		 onclick="$('#searchpform').find('#gettype').val('delivery');
								  		 					k_changeGroupStyle('searchfangshi','dd > ul > li > span ','','elect_on');
								  		 					$('#searchpform').submit();" 
								  		 >快递礼品</a></span></li>
				</ul>
        </dd>
      </dl>
      <div class="clear"></div>
      <!--价格筛选器-->
      <dl id='searchprice'>
        <dt><strong>价格：</strong></dt>
        <dd>
          <ul>
            <li> <span rel='-'>
            				<a href="javascript:void(0)" 
								  		 onclick="$('#searchpform').find('#sprice').val('');
								  		 					$('#searchpform').find('#bprice').val('');
								  		 					k_changeGroupStyle('searchprice','dd > ul > li > span ','-','elect_on');
								  		 					$('#searchpform').submit();"
								  	>全部</a></span> </li>
            <li> <span rel='1-49'>
            				<a href="javascript:void(0)" 
								  		 onclick="$('#searchpform').find('#sprice').val('1');
								  		 					$('#searchpform').find('#bprice').val('49');
								  		 					k_changeGroupStyle('searchprice','dd > ul > li > span ','1-49','elect_on');
								  		 					$('#searchpform').submit();"
								  	>1-49元</a></span> </li>
            <li> <span rel='50-99'>
            				<a href="javascript:void(0)" 
								  		 onclick="$('#searchpform').find('#sprice').val('50');
								  		 					$('#searchpform').find('#bprice').val('99');
								  		 					k_changeGroupStyle('searchprice','dd > ul > li > span ','50-99','elect_on');
								  		 					$('#searchpform').submit();"
								  	>50-99元</a></span> </li>
            <li> <span rel='100-149'>
            				<a href="javascript:void(0)" 
								  		 onclick="$('#searchpform').find('#sprice').val('100');
								  		 					$('#searchpform').find('#bprice').val('149');
								  		 					k_changeGroupStyle('searchprice','dd > ul > li > span ','300-499','elect_on');
								  		 					$('#searchpform').submit();"
								  	>100-149元</a></span> </li>
            <li> <span rel='150-'>
            				<a href="javascript:void(0)" 
								  		 onclick="$('#searchpform').find('#sprice').val('150');
								  		 					$('#searchpform').find('#bprice').val('');
								  		 					k_changeGroupStyle('searchprice','dd > ul > li > span ','150-','elect_on');
								  		 					$('#searchpform').submit();"
								  	>150以上</a></span> </li>
            <li id="price_line">
            	<span rel=''>
              <input id='inputsp'	size="4" class="price_zone" value='{$sprice}'
              				onkeyup="$('#searchpform').find('#sprice').val($(this).val());
              								 $('#searchpform').find('#bprice').val($('#inputbp').val());
              								k_changeGroupStyle('searchprice','dd > ul > li > span ','input','elect_on');" 
              				type="text">
              &nbsp;-&nbsp;
              <input id='inputbp'	size="4" class="price_zone" value='{$bprice}'
              				onkeyup="$('#searchpform').find('#bprice').val($(this).val());
              								 $('#searchpform').find('#sprice').val($('#inputsp').val());
              								k_changeGroupStyle('searchprice','dd > ul > li > span ','input','elect_on');" 
              				type="text">
              &nbsp;元</span>
              <input name="确定" onclick="$('#searchpform').submit();" value="" class="sel_btn" type="button">
            </li>
          </ul>
        </dd>
      </dl>
      <div class="clear"></div>
    </div>
    
    <!--排序-->
    <div class="list_title" id='searchorder'>
      <div>排序：</div>
      <dl class="sel_opt">
        <dt> 
        <span rel='sale' onclick="$('#searchpform').find('#stype').val('sale');
								  		 						k_changeGroupStyle('searchorder','dl > dt > span ','sale','sorted');
								  		 						$('#searchpform').submit();"
							title="销量：从高到低" class="bynew">畅销</span> 
        <span rel='new' onclick="$('#searchpform').find('#stype').val('new');
					        							 k_changeGroupStyle('searchorder','dl > dt > span ','new','sorted');
													  		 $('#searchpform').submit();"
							title="按时间排序" class="bynew ">最新</span> 
        <span rel='down' onclick="$('#searchpform').find('#stype').val('down');
        													k_changeGroupStyle('searchorder','dl > dt > span ','down','sorted');
								  		 						$('#searchpform').submit();"
							title="价格：由高到低" class="byup ">价格由高到低</span> 
        <span rel='up' onclick="$('#searchpform').find('#stype').val('up');
        													k_changeGroupStyle('searchorder','dl > dt > span ','up','sorted');
								  		 						$('#searchpform').submit();"
							title="价格：由低到高" class="byup ">价格由低到高</span></dt>
        
        <dd>
        	<span>共{$searchResult['count']}个商品，
        				当前在 {$searchResult['nowPage']}/{$searchResult['totalPages']} 页</span>
        	<span class="prep" <php>if($searchResult['nowPage']>1){
        														echo "onclick='javascript:goPage(".($searchResult['nowPage']-1).")'";
        										 }</php> >&nbsp;</span>
        	<span class="nextp"><a href="javascript:void(0)"
        										<php>if($searchResult['nowPage']<$searchResult['totalPages']){
        														echo "onclick='javascript:goPage(".($searchResult['nowPage']+1).")'";
        										 }</php>
        										 >下一页</a></span>
        </dd>
      </dl>
    </div>
  	<form id='searchpform' action="{:U('Product://Index/searchp')}#main" method="post">
			<input type="hidden" name='gettype' id='gettype' value='{$gettype}'>
  			<input type="hidden" name='popu_title' id='popu_title' value='{$popu_title}'>
			<input type="hidden" name='scode' id='scode' value='{$scode}'>
			<input type="hidden" name='sscode' id='sscode' value='{$sscode}'>
			<input type="hidden" name='ssscode' id='ssscode' value='{$ssscode}'>
			<input type="hidden" name='brandid' id='brandid' value='{$brandid}'>
			<input type="hidden" name='bprice' id='bprice' value='{$bprice}'>
			<input type="hidden" name='sprice' id='sprice' value='{$sprice}'>
			<input type="hidden" name='stype' id='stype' value='{$stype}'>
			<input type="hidden" name='pno' id='pno' value='{$pno}'>
	</form>
 	<script type="text/javascript">
 	$(document).ready(function(){
 		k_changeGroupStyle('didian',' ul > li > span ','{$popu_title}','elect_on');
		k_changeGroupStyle('pinpai',' ul > li > span ','{$brandid}','elect_on');
		k_changeGroupStyle('searchprice','dd > ul > li > span ','{$sprice}-{$bprice}','elect_on');
		k_changeGroupStyle('searchsort','dd > ul > li > span ','{$ssscode}','elect_on');
		k_changeGroupStyle('searchorder','dl > dt > span ','{$stype}','sorted');
		k_changeGroupStyle('searchfangshi','dd > ul > li > span ','{$gettype}','elect_on');
		k_initcollectionbtn();	
 	});
 	function goPage(pno){
 			$('#searchpform').find('#pno').val(pno);
 			$('#searchpform').submit();
 	}
 	</script>
    <!--第一行商品，共四个-->
<php>if(empty($searchResult)||empty($searchResult['data'])){</php>
	<div style="width:100%;text-align:center;margin-top:15px;">
		<php>$alert_message="当前搜索条件下，无相关数据！";</php>
		<include file="../Public/alert_box.html" />
	</div>

<php>}else{</php>
    <div class="list_line">
    <php>$index = -1;</php>
    <volist id="vo" name="searchResult['data']">
    	<php>$index = $index+1;</php>
    	<php>if($index%4==0){</php>
    		<div id="clear"></div>
    	</div>
    	<div class="list_line">
    	<php>}</php>
    	
      	<include file="../Product/Tpl/default/Public/product_brief_detail_box.html" />
      	
      </volist>
      <div id="clear"></div>
    </div>
    
	<div class="page_box">{$searchResult['html']}</div>
<php>}</php>


  </div>

</div>

<include file="../Public/footer.html" />